/*
* Copyright 2012	Team#6, F2-101, Neusoft
* Linpop follows the IP Messenger communication protocol (Draft-9)
* you can obtain a copy of Linpop at
*
*	http://code.google.com/p/linpop
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Apache 2.0 License.
*/

/**
    * @authr H. Chan
    * this server module is to reply registering and login request(s)
    */
#ifndef SERVER_H
#define SERVER_H

#include "commonFormats.h"


extern void  Recv_Request(char *buffer,char *IP,int port);
extern void Reply_Request(char * buffer ,char*  IP,int port);
extern void Print_error(int ret);
extern int Is_Login(char* usr,char * pwd);
extern int Is_Register(struct ClientRequest client_request);
extern struct ClientRequest Get_client_request(char* buffer);
int Is_Online(char* Name);
void Save_message(clientRequest client_request);
void Send_usrinfo(char *IP);
void Change_state(char* Name,char state);
void Print(clientRequest client_request);
void init_Command(clientRequest client_request,char *buffer) ;

int Personal_setting(clientRequest setting);
void Ip_Name(clientRequest client_request);
void Write_IP_NAME(clientRequest client_request);
void Get_IP_NAME(char *buffer);
void Delete_IP_NAME(clientRequest client_request);
void Read_message(char*NAME,char *IP);
void Setting();
void Heart();
#endif //SERVER_H
